package com.yanqu.road.server.cmd.grandchild.school;

import com.yanqu.road.pb.grandchild.GrandChildProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.grandson.GrandChildModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_GRAND_CHILD_TRAIN,desc = "孙子培养")
public class GrandChildTrainCmd extends AbstractCommand {
    private int schoolType;
    private int trainType;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        GrandChildProto.SchoolTrainReqMsg req = GrandChildProto.SchoolTrainReqMsg.parseFrom(packet.getBytes());
        schoolType = req.getType();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.getModule(GrandChildModule.class).train(schoolType);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
